package com.hyj.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hyj.entity.Readrooms;
import com.hyj.entity.Students;
import com.hyj.entity.Teachers;
import com.hyj.mapper.ReadMapper;
import com.hyj.service.ComService;



@Controller
public class ComputerController {
		@Autowired
		ReadMapper readMapper;
		@Autowired
		private ComService comService;
		
		@ResponseBody
		@RequestMapping("getAllNo")
		public Object getAllNo(String allCarNo, ModelMap map) {
			Students stu = comService.getStuAllNo(allCarNo);
			System.out.println("刷卡查的学生数据是"+stu);
			map.put("stu",stu);
			return stu;
			
		}
		@ResponseBody
		@RequestMapping("getAllCarNo")
		public Object getAllCarNo(String teCarNo, ModelMap map) {
			Teachers tea = comService.getTeaAllNo(teCarNo);
			System.out.println("刷卡查的教师数据是"+tea);
			map.put("tea",tea);
			return tea;
			
		}
		
		
		@RequestMapping("getAllRed")
		public Object getAllRed(ModelMap map) {
			List<Readrooms> list= readMapper.getRead(null);
			map.put("list",list);
			return "add";
		}
		
		
	
	
	
}
